{subtemplate header}
<style>
	#modmenu li { float: left; margin-right: 1em; }
</style>
<script type="text/javascript" src="include/js/viewthread.js?{VERHASH}"></script>
<script type="text/javascript">zoomstatus = parseInt($zoomstatus);var imagemaxwidth = '{IMAGEMAXWIDTH}';var aimgcount = new Array();</script>

<style>
	#sh_body #nav { font-size: 12px; color: #9BBFCB; }
		#sh_body #nav a { color: #9BBFCB; text-decoration: underline; }
			#sh_body #nav a:hover { color: #3C5778; }
</style>
<div id="subheader">
	<div class="wrap">
		<div id="sh_body">
			<h1>$thread[subject]</h1>
			<div id="nav"><a href="$indexname">$bbname</a> $navigation</div>
		</div>
		<div id="sh_side">
			<div class="postbtn">
				<a href="post.php?action=newthread&fid=$fid" onclick="floatwin('open_newthread', this.href, 600, 410, '600,0');return false;" id="newspecial" onmouseover="showMenu(this.id)"><em><span>{lang post_newthread}</span></em></a>
			</div>
		</div>
	</div>
</div>
<!--{if $admode && empty($insenz['hardadstatus']) && !empty($advlist['text'])}--><div class="ad_text" id="ad_text"><table summary="Text Ad" cellpadding="0" cellspacing="1">$advlist[text]</table></div><!--{else}--><div id="ad_text"></div><!--{/if}-->

<!--{if $allowposttrade || $allowpostpoll || $allowpostreward || $allowpostactivity || $allowpostdebate || $allowpostvideo || $forum['threadsorts'] || $forum['threadtypes'] || !$discuz_uid}-->
	<ul class="popupmenu_popup postmenu" id="newspecial_menu" style="display: none">
		<!--{if !$forum['allowspecialonly']}--><li><a href="post.php?action=newthread&fid=$fid" onclick="floatwin('open_newthread', this.href, 600, 410, '600,0');doane(event)">{lang post_newthread}</a></li><!--{/if}-->
		<!--{if $allowpostpoll || !$discuz_uid}--><li class="poll"><a href="post.php?action=newthread&fid=$fid&special=1">{lang post_newthreadpoll}</a></li><!--{/if}-->
		<!--{if $allowpostreward || !$discuz_uid}--><li class="reward"><a href="post.php?action=newthread&fid=$fid&special=3">{lang post_newthreadreward}</a></li><!--{/if}-->
		<!--{if $allowpostdebate || !$discuz_uid}--><li class="debate"><a href="post.php?action=newthread&fid=$fid&special=5">{lang post_newthreaddebate}</a></li><!--{/if}-->
		<!--{if $allowpostactivity || !$discuz_uid}--><li class="activity"><a href="post.php?action=newthread&fid=$fid&special=4">{lang post_newthreadactivity}</a></li><!--{/if}-->
		<!--{if $allowpostvideo || !$discuz_uid}--><li class="video"><a href="post.php?action=newthread&fid=$fid&special=6">{lang post_newthreadvideo}</a></li><!--{/if}-->
		<!--{if $allowposttrade || !$discuz_uid}--><li class="trade"><a href="post.php?action=newthread&fid=$fid&special=2">{lang post_newthreadtrade}</a></li><!--{/if}-->
		<!--{if $forum['threadsorts'] && !$forum['allowspecialonly']}-->
			<!--{loop $forum['threadsorts']['types'] $id $threadsorts}-->
				<!--{if $forum['threadsorts']['show'][$id]}-->
					<li class="popupmenu_option"><a href="post.php?action=newthread&amp;fid=$fid&amp;extra=$extra&amp;sortid=$id">$threadsorts</a></li>
				<!--{/if}-->
			<!--{/loop}-->
			<!--{loop $forum['typemodels'] $id $model}-->
				<li class="popupmenu_option"><a href="post.php?action=newthread&amp;fid=$fid&amp;extra=$extra&amp;modelid=$id">$model[name]</a></li>
			<!--{/loop}-->
		<!--{/if}-->
	</ul>
<!--{/if}-->

<div id="wrap" class="wrap s_clear">
	<div class="main">
		<div class="pageline s_clear">
			$multipage
			<div class="pages"><span class="pageback"><a href="$upnavlink">{lang return}{lang forum}: <em>$forum[name]</em></a></span></div>
		</div>
		{eval $postcount = 0;}
		<!--{loop $postlist $post}-->
			{subtemplate viewthread_node}
		<!--{/loop}-->

		<div id="postlistreply"><div id="post_new" style="display: none"></div></div>

		<form method="post" name="modactions" id="modactions">
		<input type="hidden" name="formhash" value="{FORMHASH}" />
		<input type="hidden" name="optgroup" />
		<input type="hidden" name="operation" />
		<input type="hidden" name="listextra" value="$extra" />
		</form>
		
		$tagscript
		
		<div class="pageline pagebtm s_clear">
			$multipage
			<div class="pages"><span class="pageback"><a href="$upnavlink">{lang return}{lang forum}: <em>$forum[name]</em></a></span></div>
		</div>
		
		<!--{if $fastpost && $allowpostreply}-->
			{subtemplate viewthread_fastpost}
		<!--{/if}-->
		
	</div>
	<div class="side">
		<div id="forumstats" class="sidebox">
			<h4>{lang thread}{lang action}</h4>
			<ul>
				<li><a id="ajax_favorite" {if $discuz_uid}href="my.php?item=favorites&amp;tid=$tid" onclick="ajaxmenu(event, this.id, 3000, 0)"{else}href="logging.php?action=login" onclick="floatwin('open_login', this.href, 600, 400);return false;"{/if}>{lang thread_favorite}</a></li>
				<li><a href="">Digg</a></li>
				<li><a href="">Del.icio.us</a></li>
				<li><a href="">Twitter</a></li>
				<li><a href="">Facebook</a></li>
				<li><a href="">Google Bookmark</a></li>
				<li><a id="emailfriend" href="misc.php?action=emailfriend&amp;tid=$tid" onclick="floatwin('open_emailfriend', this.href, 250, {if $discuz_uid}380{else}200{/if});return false;">{lang thread_email_friend}</a></li>
				<li><a href="viewthread.php?action=printable&amp;tid=$tid" target="_blank">{lang thread_printable}</a></li>
			</ul>
		</div>
		<!--{if $forum['ismoderator']}-->
		<div class="sidebox" id="modmenu">
			<h4>{lang admin_modoptions}</h4>
			<script type="text/javascript">
				function modaction(action, pid, extra) {
					if(!action) {
						return;
					}
					var extra = !extra ? '' : '&' + extra;
					if(!pid && in_array(action, ['delpost', 'banpost'])) {
						var checked = 0;
						var pid = '';
						for(var i = 0; i < $('modactions').elements.length; i++) {
							if($('modactions').elements[i].name.match('topiclist')) {
								checked = 1;
								break;
							}
						}
					} else {
						var checked = 1;
					}
					if(!checked) {
						alert('{lang admin_select_required}');
					} else {
						floatwinreset = 1;
						$('modactions').action = 'topicadmin.php?action='+ action +'&fid=$fid&tid=$tid&infloat=yes&nopost=yes' + (!pid ? '' : '&topiclist[]=' + pid) + extra;
						floatwin('open_mods', '', 250, action != 'split' ? 215 : 365);
						$('floatwin_mods').innerHTML = '';
						ajaxpost('modactions', 'floatwin_mods', '');
						if(is_ie) {
							doane(event);
						}
						hideMenu();
					}
				}
				function modthreads(optgroup, operation) {
					var operation = !operation ? '' : operation;
					floatwinreset = 1;
					$('modactions').action = 'topicadmin.php?action=moderate&fid=$fid&moderate[]=$tid&infloat=yes&nopost=yes' + (optgroup != 3 && optgroup != 2 ? '&from=$tid' : '');
					floatwin('open_mods', '', 250, optgroup < 2 ? 365 : 215);
					$('modactions').optgroup.value = optgroup;
					$('modactions').operation.value = operation;
					$('floatwin_mods').innerHTML = '';
					ajaxpost('modactions', 'floatwin_mods', '');
					if(is_ie) {
						doane(event);
					}
				}
				function pidchecked(obj) {
					if(obj.checked) {
						if(is_ie && !is_opera) {
							var inp = document.createElement('<input name="topiclist[]" />');
						} else {
							var inp = document.createElement('input');
							inp.name = 'topiclist[]';
						}
						inp.id = 'topiclist_' + obj.value;
						inp.value = obj.value;
						inp.style.display = 'none';
						$('modactions').appendChild(inp);
					} else {
						$('modactions').removeChild($('topiclist_' + obj.value));
					}
				}
				var modclickcount = 0;
				function modclick(obj, pid) {
					if(obj.checked) {
						modclickcount++;
					} else {
						modclickcount--;
					}
					$('modcount').innerHTML = modclickcount;
					if(modclickcount > 0) {
						var offset = fetchOffset(obj);				
						$('modlayer').style.top = offset['top'] - 65 + 'px';
						$('modlayer').style.left = offset['left'] - 215 + 'px';
						$('modlayer').style.display = '';
					} else {
						$('modlayer').style.display = 'none';
					}
				}
			</script>
			<ul class="s_clear">
			<!--{if $thread['digest'] >= 0}-->
				<!--{if $allowdelpost}--><li class="wide"><a href="javascript:;" onclick="modthreads(3, 'delete')">{lang admin_delthread}</a></li><!--{/if}-->
				<li class="wide"><a href="javascript:;" onclick="modthreads(3, 'down')">{lang admin_bump_down}</a></li>
				<!--{if $allowstickthread}-->
					<li class="wide"><a href="javascript:;" onclick="modthreads(1, 'stick')">{lang admin_stick}</a></li>
				<!--{/if}-->
				<li class="wide"><a href="javascript:;" onclick="modthreads(1, 'highlight')">{lang admin_highlight}</a></li>
				<li class="wide"><a href="javascript:;" onclick="modthreads(1, 'digest')">{lang admin_digest}</a></li>
				<!--{if $forum['modrecommend']['open'] && $forum['modrecommend']['sort'] != 1}-->
					<li class="wide"><a href="javascript:;" onclick="modthreads(1, 'recommend')">{lang admin_recommend}</a></li>
				<!--{/if}-->
				<li class="wide"><a href="javascript:;" onclick="modthreads(4)">{lang admin_openclose}</a></li>
				<li class="wide"><a href="javascript:;" onclick="modthreads(2, 'move')">{lang admin_move}</a></li>
				<li class="wide"><a href="javascript:;" onclick="modthreads(2, 'type')">{lang admin_type}</a></li>
				<!--{if !$thread['special']}-->
					<li class="wide"><a href="javascript:;" onclick="modaction('copy')">{lang admin_copy}</a></li>
					<li class="wide"><a href="javascript:;" onclick="modaction('merge')">{lang admin_merges}</a></li>
					<!--{if $thread['price'] > 0 && $allowrefund}-->
						<li class="wide"><a href="javascript:;" onclick="modaction('refund')">{lang admin_refund}</a></li>
					<!--{/if}-->
				<!--{/if}-->
				<li class="wide"><a href="javascript:;" onclick="modaction('split')">{lang admin_split}</a></li>
				<li class="wide"><a href="javascript:;" onclick="modaction('repair')">{lang admin_repair}</a></li>
			<!--{/if}-->
			<!--{if $thread['special'] == 3}-->		
				<li class="wide"><a href="javascript:;" onclick="modaction('removereward')">{lang admin_remove_reward}</a></li>
			<!--{/if}-->
			</ul>
			<!--{if $allowbanpost || $allowdelpost}-->
				<div id="modlayer" style="display:none;position:position;width:165px;">
					<span>{lang admin_select}</span><strong id="modcount"></strong><span>{lang piece}: </span>
					<!--{if $allowbanpost}-->
						<a href="javascript:;" onclick="modaction('warn')">{lang warn}</a>
						<a href="javascript:;" onclick="modaction('banpost')">{lang admin_banpost}</a>
					<!--{/if}-->
					<!--{if $allowdelpost}-->
						<a href="javascript:;" onclick="modaction('delpost')">{lang delete}</a>
					<!--{/if}-->
				</div>
			<!--{/if}-->
		</div>
		<!--{/if}-->
		
		<!--{if $visitedforums}-->
		<div class="sidebox">
			<h4>{lang forum_jump}</h4>
			<ul>
			$visitedforums
			</ul>
		</div>
		<!--{/if}-->
	</div>





<script type="text/javascript">
var maxpage = {if $maxpage}$maxpage{else}1{/if};
if(maxpage > 1) {
	document.onkeyup = function(e){
		e = e ? e : window.event;
		var tagname = is_ie ? e.srcElement.tagName : e.target.tagName;
		if(tagname == 'INPUT' || tagname == 'TEXTAREA') return;
		actualCode = e.keyCode ? e.keyCode : e.charCode;
		{if $page < $maxpage}
		if(actualCode == 39) {
			window.location = 'viewthread.php?tid=$tid&page={echo $page+1}';
		}
		{/if}
		{if $page > 1}
		if(actualCode == 37) {
			window.location = 'viewthread.php?tid=$tid&page={echo $page-1}';
		}
		{/if}
	}
}
</script>

{subtemplate footer}
<!--{if $relatedthreadupdate}-->
	<script type="text/javascript" src="relatethread.php?tid=$tid&amp;subjectenc=$thread[subjectenc]&amp;tagsenc=$thread[tagsenc]&amp;verifykey=$verifykey&amp;up=$qihoo_up"></script>
<!--{/if}-->
<!--{if $tagupdate}-->
	<script type="text/javascript" src="relatekw.php?tid=$tid"></script>
<!--{/if}-->
<!--{if $qihoo['relate']['bbsnum'] && $statsdata}-->
	<img style="display:none;" src="http://pvstat.qihoo.com/dimana.gif?_pdt=discuz&_pg=s100812&_r=$randnum&_dim_k=orgthread&_dim_v={echo urlencode($boardurl);}||{$statsdata}||0" width="1" height="1" alt="" />
	<img style="display:none;" src="http://pvstat.qihoo.com/dimana.gif?_pdt=discuz&_pg=s100812&_r=$randnum&_dim_k=relthread&_dim_v={$statskeywords}||{$statsurl}" width="1" height="1" alt="" />
<!--{/if}-->